package com.lily.aidouzixun.datacenter;

import com.alibaba.fastjson.JSONObject;

/**
 * 用于分页显示
 */
public class PagerInfo {
    private static final String CUR_PAGE_JOSANKEY = "curpage";
    private static final String TOTAL_PAGE_JOSANKEY = "totalpage";

    private int curpage;
    private int totalpage;

    public int getCurpage() {
        return curpage;
    }

    public void setCurpage(int curpage) {
        this.curpage = curpage;
    }

    public int getTotalpage() {
        return totalpage;
    }

    public void setTotalpage(int totalpage) {
        this.totalpage = totalpage;
    }

    public  void parseInfo(JSONObject jsonObj) {
        if (jsonObj.has(CUR_PAGE_JOSANKEY)) {
            setCurpage(jsonObj.optInt(CUR_PAGE_JOSANKEY));
        }
        if (jsonObj.has(TOTAL_PAGE_JOSANKEY)) {
            setTotalpage(jsonObj.optInt(TOTAL_PAGE_JOSANKEY));
        }
    }
}
